package com.ruoyi.system.domain;

import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 订餐管理对象 meal_order
 * 
 * @author ruoyi
 * @date 2025-08-15
 */
@Data
public class MealOrder extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    private Long id;

    /**
     * 序号
     */
    @Excel(name = "序号")
    private Integer serialNumber;

    /**
     * 培训ID（无外键）
     */
    @Excel(name = "培训ID", readConverterExp = "无=外键")
    private Long trainingId;

    /**
     * 员工ID（无外键）
     */
    @Excel(name = "员工ID", readConverterExp = "无=外键")
    private Long empId;

    /**
     * 用餐日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "用餐日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date mealDate;

    /**
     * 餐别
     */
    @Excel(name = "餐别")
    private String mealType;

    /**
     * 是否订餐（1=是,0=否）
     */
    @Excel(name = "状态", readConverterExp = "1=是,0=否,2=已核销,3=未填写")
    private Integer isOrdered;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "核销时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date verifyTime;

    private List<MealOrderVO.MealDetail> mealDetails;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setTrainingId(Long trainingId) {
        this.trainingId = trainingId;
    }

    public Long getTrainingId() {
        return trainingId;
    }

    public void setEmpId(Long empId) {
        this.empId = empId;
    }

    public Long getEmpId() {
        return empId;
    }

    public void setMealDate(Date mealDate) {
        this.mealDate = mealDate;
    }

    public Date getMealDate() {
        return mealDate;
    }

    public void setMealType(String mealType) {
        this.mealType = mealType;
    }

    public String getMealType() {
        return mealType;
    }

    public void setIsOrdered(Integer isOrdered) {
        this.isOrdered = isOrdered;
    }

    public Integer getIsOrdered() {
        return isOrdered;
    }

    public void setSerialNumber(Integer serialNumber) {
        this.serialNumber = serialNumber;
    }

    public Integer getSerialNumber() {
        return serialNumber;
    }

    public List<com.ruoyi.system.domain.MealOrderVO.MealDetail> getMealDetails() {
        return mealDetails;
    }

    public void setMealDetails(List<com.ruoyi.system.domain.MealOrderVO.MealDetail> mealDetails) {
        this.mealDetails = mealDetails;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("serialNumber", getSerialNumber())
                .append("trainingId", getTrainingId())
                .append("empId", getEmpId())
                .append("mealDate", getMealDate())
                .append("mealType", getMealType())
                .append("isOrdered", getIsOrdered())
                .toString();
    }
    public static class MealDetail {
        /** 培训ID */
        private Long trainingId;

        /** 员工ID */
        private Long empId;

        /** 用餐日期 */
        @JsonFormat(pattern = "yyyy-MM-dd")
        private Date mealDate;

        /** 餐别 (午餐/晚餐) */
        private String mealType;

        /** 是否订餐（1=是,0=否） */
        private Integer isOrdered;

        public Long getTrainingId() {
            return trainingId;
        }

        public void setTrainingId(Long trainingId) {
            this.trainingId = trainingId;
        }

        public Long getEmpId() {
            return empId;
        }

        public void setEmpId(Long empId) {
            this.empId = empId;
        }

        public Date getMealDate() {
            return mealDate;
        }

        public void setMealDate(Date mealDate) {
            this.mealDate = mealDate;
        }

        public String getMealType() {
            return mealType;
        }

        public void setMealType(String mealType) {
            this.mealType = mealType;
        }

        public Integer getIsOrdered() {
            return isOrdered;
        }

        public void setIsOrdered(Integer isOrdered) {
            this.isOrdered = isOrdered;
        }
    }
}
